<extend name="Public/base"/>

<block name="body">
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <!--<h2>修改（{$vo.name}）城市</h2>-->
        <h2>修改轮播图</h2>
    </div>
    <ul class="tab-nav nav">


        <li class="current"><a href="javascript:void(0)">基本信息</a></li>
    </ul>
    
    <form action="{:U()}" method="post" class="form-horizontal" enctype="multipart/form-data" name="form1">
    <input type="hidden" name="id" value="<?php echo $id;?>">
    <!--<input type="hidden" name="leveltype" value="{$vo.leveltype}">-->
    <div class="tab-content">
       <div class="form-item">
            <div class="controls">
                <label class="item-label">缩略图<span class="check-tips">（图片必须上传）</span></label>
                <input type="file" id="upload_picture">
                <input type="hidden" name="icon" id="icon" value="{$info['icon']|default=''}"/>
                <div class="upload-img-box">
                <notempty name="info['icon']">
                    <div class="upload-pre-item"><img src="__ROOT__{$info.icon|get_cover='path'}"/><span title="删除图片" class="js_icon_del" data-name="icon"></span></div>
                </notempty>
                </div>
            </div>
            <script type="text/javascript">
            //上传图片
            /* 初始化上传插件 */
            $("#upload_picture").uploadify({
                "height"          : 30,
                "swf"             : "__STATIC__/uploadify/uploadify.swf",
                "fileObjName"     : "download",
                "buttonText"      : "上传图片",
                "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
                "width"           : 120,
                'removeTimeout'   : 1,
                'fileTypeExts'    : '*.jpg; *.png; *.gif;',
                "onUploadSuccess" : uploadPicture,
                'onFallback' : function() {
                    alert('未检测到兼容版本的Flash.');
                }
            });
            function uploadPicture(file, data){
                var data = $.parseJSON(data);
                var src = '';
                if(data.status){
                    $("#icon").val(data.id);
                    src = data.url || '__ROOT__' + data.path;
                    $("#icon").parent().find('.upload-img-box').html(
                        '<div class="upload-pre-item"><img src="' + src + '"/><span title="删除图片" class="js_icon_del" data-name="icon"></span></div>'
                    );
                } else {
                    updateAlert(data.info);
                    setTimeout(function(){
                        $('#top-alert').find('button').click();
                        $(that).removeClass('disabled').prop('disabled',false);
                    },1500);
                }
            }
            </script>
        </div>
        
        
        <div class="form-item">
            <button class="btn submit-btn" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>
   
    </form>
</block>

<block name="script">
<include file="Public:datetime" />
    <script type="text/javascript">
	
		
	
        //导航高亮
        highlight_subnav('{:U('Content/banner')}');
		
		
    </script>
</block>
